---
kind: Service
apiVersion: v1
metadata:
  name: csi-cbsplugin-attacher
  namespace: kube-system
  labels:
    app: csi-cbsplugin-attacher
spec:
  selector:
    app: csi-cbsplugin-attacher
  ports:
    - name: dummy
      port: 12345

---
kind: StatefulSet
apiVersion: apps/v1beta1
metadata:
  name: csi-cbsplugin-attacher
  namespace: kube-system
spec:
  serviceName: "csi-cbsplugin-attacher"
  replicas: 1
  template:
    metadata:
      labels:
        app: csi-cbsplugin-attacher
    spec:
      serviceAccount: tencentcloud-csi-attacher
      containers:
        - name: csi-cbsplugin-attacher
          image: {{ tencentcloud_csi_attacher_repo }}:{{ tencentcloud_csi_attacher_tag }}
          args:
            - "--v=5"
            - "--csi-address=$(ADDRESS)"
          env:
            - name: ADDRESS
              value: /csi/csi.sock
          imagePullPolicy: "IfNotPresent"
          volumeMounts:
            - name: socket-dir
              mountPath: /csi
      volumes:
        - name: socket-dir
          hostPath:
            path: /var/lib/kubelet/plugins/com.tencent.cloud.csi.cbs
            type: DirectoryOrCreate